package j05changyonglei;

class Person{
    String name;

    public Person(String name) {
        this.name = name;
    }

    @Override
    protected void finalize() throws Throwable {
        System.out.println("会收车来了！");
    }
}

public class J5 {
    public static void main(String[] args) {
        Person zhangfei = new Person("张飞");
//        zhangfei = null;
        //建议会收车过来！
        System.gc();
        System.out.println(111);
        System.out.println(111);
        System.out.println(111);
        System.out.println(111);
        System.out.println(111);
        System.out.println(111);
        System.out.println(111);
        System.out.println(111);
    }
}
